<?php echo $javascript->link('jquery.min.js', false); ?>
<?php echo $javascript->link('jquery-ui-1.7.2.custom.min.js', false); ?>
<?php echo $javascript->link('button', false); ?>

<?php echo $this->element('admin_sidepain'); ?>

<div class="admin-maincontent">
    <div id="addUser" class="ui-widget ui-corner-all">
        <div class="ui-widget-header">用户添加</div>

        <?php if ($session->check('message')): ?>
        <div class="ui-widget">
            <div class="ui-state-highlight ui-corner-all" style="margin: 0.5em 0; padding: 0.7em; text-align: left;">
                <span class="ui-icon ui-icon-alert" style="float: left; margin-right: 0.3em;"></span>
                <?php $session->flash();?>
            </div>
        </div>
        <?php endif; ?>
    <?php
        echo $form->create('User', array('action' => 'admin_addUser'));
        echo $form->input('username');
        echo $form->input('password');
        echo $form->input('nickname', array('maxLength’' => '25', 'label' => '昵称'));
        echo $form->input('email', array('label' => 'Email'));
        $themes = array('cupertino' => 'cupertino', 'flick' => 'flick', 'eggplant' => 'eggplant', 'overcast' => 'overcast', 
            'smoothness' => 'smoothness', 'ui-lightness' => 'ui-lightness');
        echo $form->input('theme', array('label' => '主题', 'options' => $themes, 'default' => 'cupertino'));
        $groups = array();
        foreach($GroupsInfo as $key => $info) {
            $i = $info['Group']['id'];
            $value = $info['Group']['name'];
            $groups[$i] = $value;
        }
        echo $form->input('group_id', array('label' => '用户组', 'options' => $groups, 'default' => 3));
        echo $form->end( array('label' => '添加', 'class' => 'fg-button ui-state-default ui-corner-all ')); 
    ?>
    </div>
</div>